package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();
        String name = main.getName();//获取线程的名字
        System.out.println(name);
        long id = main.getId();//获取唯一标识
        System.out.println("唯一标识4"+id);
        System.out.println(0xf);
        int priority = main.getPriority();
        System.out.println(priority);//获取优先级
        boolean alive = main.isAlive();
        System.out.println(alive);//是否活着
        boolean daemon = main.isDaemon();//是否为守护线程
        System.out.println(daemon);
        boolean isInterrupted = main.isInterrupted();
        System.out.println(isInterrupted);
    }
}
